<%@ include file="/taglibs.jsp"%>
<fmt:message key="date.format" var="df" scope="page"/>
<head>
	<title><fmt:message key="amendmentFile.title"/></title>
</head>

<s:set name="lstFileMgrRequest" value="rejectedFileList" scope="request"/>

<s:form name="fileForm" action="remove-amendment" method="post" validate="true">
<div align="right">
	<s:a href="javascript:void(0)" id="save" onclick="$('form').submit();">
			<img src="${ctx}/images/btn_link_accept_file.png">
		</s:a>
</div>
<display:table name="lstFileMgrRequest" class="table" requestURI="" id="fmgr" >
    
    <display:column style="width:250px" property="file.submitter" titleKey="file.submitter" escapeXml="true"/>
    <display:column property="approver.fullname" titleKey="amendmentFile.table.header.sender" escapeXml="true"/>
    
    <display:column titleKey="statisticsFileByUser.form.table.header.receivedDate" escapeXml="true">
    	<joda:format value="${fmgr.approvedDate}" pattern="dd/MM/yyyy hh:mm"/>
    </display:column>
    
    <display:column property="approvedComment" titleKey="approved_comment" escapeXml="true"/>
    
    <display:column style="width:30px" sortable="false" href="viewFile.html" media="html" paramId="id" paramProperty="file.id" titleKey="button.detail.title">
        Xem
    </display:column>
    
    <s:if test="rejectedFileList.fullListSize != 0">
	    <display:column title="<input type='checkbox' class='checkAll'>" >
	    	<input type="checkbox" class="cb-element" value="${fmgr.id}" name="ids">
	    </display:column>
    </s:if>
</display:table>
	<s:a href="javascript:void(0)" id="save" onclick="$('form').submit();">
			<img src="${ctx}/images/btn_link_accept_file.png" align="left" >
		</s:a>
</s:form>
<script type="text/javascript">
//highlightTableRows("fmgr");

$( '.cb-element' ).live('change', function(){
	$( '.cb-element' ).length == $( '.cb-element:checked' ).length ? 
			$( '.checkAll' ).attr( 'checked', 'checked' ): $( '.checkAll' ).attr( 'checked', '' );
	$( this ).next().val($( this ).is( ':checked' ));
});
$( '.checkAll' ).live('change', function(){
	$( '.cb-element' ).attr('checked', $( this ).is( ':checked' ) ? 'checked' : '');
	var chkAll = $( this );
	$( '.cb-element' ).each(function(){
		$( this ).next().val(chkAll.is( ':checked' ));
	});
});
</script>